// 角色类型定义
export interface Character {
  id: string;
  name: string;
  nameEn: string;
  description: string;
  personality: string[];
  background: string;
  avatar: string;
  language: string[];
  skills: Skill[];
}

// 角色技能类型
export interface Skill {
  id: string;
  name: string;
  description: string;
}

// 创建角色请求体类型
export interface CharacterCreate {
  id: string;
  name: string;
  nameEn: string;
  avatar: string | null;
  description: string;
  background: string;
  language: string[];
  personality: string[];
  skills: Array<{
    name: string;
    description: string;
  }>;
}

// 更新角色请求体类型
export interface CharacterUpdate {
  name?: string;
  description?: string;
  background?: string;
  language?: string[];
  personality?: string[];
  skills?: Array<{
    name: string;
    description: string;
  }>;
}

// 对话消息类型
export interface Message {
  id: string;
  text: string;
  sender: 'user' | 'character';
  timestamp: number;
  isVoice?: boolean;
}

// 角色响应消息类型
export interface CharacterResponse {
  message: string; // 只包含角色台词的纯净文本
  character_id: string;
  character_name: string;
  timestamp: string; // ISO格式时间
  emotion: string; // 角色情绪
  action: string; // 角色动作
  metadata: {
    response_type: string;
    raw: string; // 包含模型思考内容的原始文本
    character_personality: string[];
    character_skills: string[];
  };
}

// 对话历史类型
export interface Conversation {
  id: string;
  characterId: string;
  messages: Message[];
  lastUpdated: number;
}

// 搜索结果类型
export interface SearchResult {
  characters: Character[];
  total: number;
}